﻿
Public Class DAHoliday
    Inherits DataProvider


    Shared Sub ConfigServerName(ByVal serverName As String)

        ' call constructor base class
        ConfigServer(serverName)

    End Sub

    ''' <summary>
    ''' check day is hoilday
    ''' </summary>
    ''' <param name="organNo"></param>
    ''' <param name="day"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Shared Function CheckHoliday(ByVal organNo As String, ByVal day As String) As Integer

        Dim params As String() = New String() {"@organNo", "@day"}

        Dim values As Object() = New Object() {organNo, day}

        Return NonQueryReturn("CheckHoliday", params, values)

    End Function


    ''' <summary>
    ''' Get holiday by organ no and day from, day to
    ''' </summary>
    ''' <param name="organNo"></param>
    ''' <param name="dayFrom"></param>
    ''' <param name="dayTo"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Shared Function GetHoliday(ByVal organNo As String, ByVal dayFrom As String, ByVal dayTo As String) As DataTable

        Dim params As String() = New String() {"@organNo", "@dayFrom", "@dayTo"}

        Dim values As Object() = New Object() {organNo, dayFrom, dayTo}

        Return Query("GetHoliday", params, values)


    End Function


    ''' <summary>
    ''' Insert holiday to database
    ''' </summary>
    ''' <param name="organNo"></param>
    ''' <param name="holidayDate"></param>
    ''' <param name="remarks"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Shared Function InsertHoliday(ByVal organNo As String, ByVal holidayDate As String, ByVal remarks As Object) As Integer

        Dim params As String() = New String() {"@organNo", "@holidayDate", "@remarks"}

        Dim values As Object() = New Object() {organNo, holidayDate, remarks}

        Return Update("UpdateHoliday", params, values)

    End Function

    ''' <summary>
    ''' Delete holiday
    ''' </summary>
    ''' <param name="organNo"></param>
    ''' <param name="holidayDate"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Shared Function DeleteHoliday(ByVal organNo As String, ByVal holidayDate As String) As Integer

        Dim params As String() = New String() {"@organNo", "@holidayDate"}

        Dim values As Object() = New Object() {organNo, holidayDate}

        Return Update("DeleteHoliday", params, values)

    End Function



End Class
